API Documentation
Public Member Functions | List of all members
nkGraphics::CameraManager Class Referencefinal

Manages the camera within the component. More...

Inheritance diagram for nkGraphics::CameraManager:

Public Member Functions

CameracreateOrRetrieve (const std::string_view &name)
 
Cameraget (const std::string_view &name)
 
CameragetByIndex (unsigned int index)
 
void rename (const std::string_view &currentName, const std::string_view &newName)
 
void erase (const std::string_view &name)
 
CameragetActiveRenderCam () const
 
CameragetActiveCullingCam () const
 
CameragetActiveLodCam () const
 
CameragetDefaultCam () const
 
CameragetActiveContextCam () const
 
CameragetContextRenderCam (RenderContext *context)
 
CameragetContextCullingCam (RenderContext *context)
 
CameragetContextLodCam (RenderContext *context)
 
void setActiveRenderCam (Camera *cam)
 
void setActiveCullingCam (Camera *cam)
 
void setActiveLodCam (Camera *cam)
 
void setDefaultCam (Camera *cam)
 
void setActiveContextCam (Camera *cam)
 
void setContextRenderCam (RenderContext *context, Camera *cam)
 
void setContextCullingCam (RenderContext *context, Camera *cam)
 
void setContextLodCam (RenderContext *context, Camera *cam)
 
void resetRenderCamToActiveContext ()
 
void resetCullingCamToActiveContext ()
 
void resetLodCamToActiveContext ()
 
void resetRenderCamToDefault ()
 
void resetCullingCamToDefault ()
 
void resetLodCamToDefault ()
 
void prepareForContext (RenderContext *context)
 

Detailed Description

Manages the camera within the component.

At all time, the manager is responsible for the memory it allocates. External code should never deallocate memoyr returned by the function calls.

Member Function Documentation

◆ createOrRetrieve()

Camera* nkGraphics::CameraManager::createOrRetrieve ( const std::string_view &  name)

Creates if unavailable, or retrieve if available, a camera attached to a name.

Parameters
nameThe name of the camera to retrieve.
Returns
A fresh camera, or the camera already attached to the name provided.
Remarks
The manager owns the camera returned. External code should not delete it. See erase().

◆ get()

Camera* nkGraphics::CameraManager::get ( const std::string_view &  name)

Retrieves an existant camera.

Parameters
nameThe name of the camera to retrieve.
Returns
The camera if existant, nullptr else.

◆ getByIndex()

Camera* nkGraphics::CameraManager::getByIndex ( unsigned int  index)

Retrieves an existant camera by index.

Parameters
indexThe index of the camera to retrieve.
Returns
The camera attached to the index if available, nullptr else.
Remarks
The index attached to a camera can change if a camera is

◆ rename()

void nkGraphics::CameraManager::rename ( const std::string_view &  currentName,
const std::string_view &  newName 
)

Renames a camera and change the name associated to it.

Parameters
currentNameThe current name of the camera.
newNameThe new name to attach to the camera.

◆ erase()

void nkGraphics::CameraManager::erase ( const std::string_view &  name)

Erases a camera an frees the memory attached to it.

Parameters
nameThe name of the camera to erase.

◆ getActiveRenderCam()

Camera* nkGraphics::CameraManager::getActiveRenderCam ( ) const
Returns
The current active render camera.

◆ getActiveCullingCam()

Camera* nkGraphics::CameraManager::getActiveCullingCam ( ) const
Returns
The current active culling camera.

◆ getActiveLodCam()

Camera* nkGraphics::CameraManager::getActiveLodCam ( ) const
Returns
The current active lod camera.

◆ getDefaultCam()

Camera* nkGraphics::CameraManager::getDefaultCam ( ) const
Returns
The default camera to use.

◆ getActiveContextCam()

Camera* nkGraphics::CameraManager::getActiveContextCam ( ) const
Returns
The current active context's cam.

◆ getContextRenderCam()

Camera* nkGraphics::CameraManager::getContextRenderCam ( RenderContext context)
Parameters
contextThe context from which to retrieve the render camera.
Returns
The render camera associated to the context.

◆ getContextCullingCam()

Camera* nkGraphics::CameraManager::getContextCullingCam ( RenderContext context)
Parameters
contextThe context from which to retrieve the culling camera.
Returns
The culling camera associated to the context.

◆ getContextLodCam()

Camera* nkGraphics::CameraManager::getContextLodCam ( RenderContext context)
Parameters
contextThe context from which to retrieve the lod camera.
Returns
The lod camera associated to the context.

◆ setActiveRenderCam()

void nkGraphics::CameraManager::setActiveRenderCam ( Camera cam)

Sets the active render cam to use. Serves as a reference for feeding shaders with matrices during a pass.

Parameters
camThe camera to use.

◆ setActiveCullingCam()

void nkGraphics::CameraManager::setActiveCullingCam ( Camera cam)

Sets the active culling cam to use. Serves as a reference for culling render queues rendered during a pass.

Parameters
camThe camera to use.

◆ setActiveLodCam()

void nkGraphics::CameraManager::setActiveLodCam ( Camera cam)

Sets the active lod cam to use. Serves as a reference for selecting LOD during a pass.

Parameters
camThe camera to use.

◆ setDefaultCam()

void nkGraphics::CameraManager::setDefaultCam ( Camera cam)

Sets the default cam to use when no camera is specified for a pass.

Parameters
camThe camera to use.

◆ setActiveContextCam()

void nkGraphics::CameraManager::setActiveContextCam ( Camera cam)

Sets the active context camera. Will be used by stages (LOD, culling...) that were not overwritten.

Parameters
camThe camera to use.

◆ setContextRenderCam()

void nkGraphics::CameraManager::setContextRenderCam ( RenderContext context,
Camera cam 
)

Sets the render camera associated with a context.

Parameters
contextThe context which camera is to be set.
camThe camera to use.

◆ setContextCullingCam()

void nkGraphics::CameraManager::setContextCullingCam ( RenderContext context,
Camera cam 
)

Sets the culling camera associated with a context.

Parameters
contextThe context which camera is to be set.
camThe camera to use.

◆ setContextLodCam()

void nkGraphics::CameraManager::setContextLodCam ( RenderContext context,
Camera cam 
)

Sets the LOD camera associated with a context.

Parameters
contextThe context which camera is to be set.
camThe camera to use.

◆ resetRenderCamToActiveContext()

void nkGraphics::CameraManager::resetRenderCamToActiveContext ( )

Resets the rendering cam to the one the active context sets.

◆ resetCullingCamToActiveContext()

void nkGraphics::CameraManager::resetCullingCamToActiveContext ( )

Resets the culling cam to the one the active context sets.

◆ resetLodCamToActiveContext()

void nkGraphics::CameraManager::resetLodCamToActiveContext ( )

Resets the LOD cam to the one the active context sets.

◆ resetRenderCamToDefault()

void nkGraphics::CameraManager::resetRenderCamToDefault ( )

Resets the rendering cam to the default one.

◆ resetCullingCamToDefault()

void nkGraphics::CameraManager::resetCullingCamToDefault ( )

Resets the culling cam to the default one.

◆ resetLodCamToDefault()

void nkGraphics::CameraManager::resetLodCamToDefault ( )

Resets the LOD cam to the default one.

◆ prepareForContext()

void nkGraphics::CameraManager::prepareForContext ( RenderContext context)

Prepare the active cameras with the ones that have been set for a context.

Parameters
contextThe context that should populate the active cameras.

The documentation for this class was generated from the following file: